<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="zh-cn" lang="zh-cn" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="zh-cn"/>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script src="javaS2.jse"></script>
<script>
window.onload = function(e){
	e = evnt(e);
	var o = $("toid");
	//alert(o.offsetWidth);alert(o.offsetHeight);alert(o.offsetLeft);alert(o.offsetTop);
	document.onmousemove = function(e){
		e = evnt(e);
		var ol = o.offsetLeft,or = o.offsetLeft + o.offsetWidth,ot=o.offsetTop,ob=o.offsetTop+o.offsetHeight;
		var ml = e.clientX,mr = e.clientY;
		$("info").innerHTML = "ml:"+ml+" mr:"+mr+" ol:"+ol+" or:"+or+" ot:"+ot+" ob:"+ob;
		if (ml >= ol && ml <= or && mr >= ot && mr <= ob)
		{
			o.style.border="1px solid yellow";
		}
		else{
			o.style.border="";
		}
	}
}
</script>
<link rel="stylesheet" type="text/css" href="javaS2.css"/>
<title></title>
</head>
<body>

<div id="toid" style="background:blue;float:right">fdf</div>

<div id="info"></div>

</body>
</html>